// search
import {reqGetSearchInfo} from "@/api"


const actions= {
    async getSearchList({commit},value={}){
        let result = await reqGetSearchInfo(value)
        if(result.code==200)
        {
            commit("GETSEARCHLIST",result.data)
        }
    }
}
const mutations= {
    GETSEARCHLIST(state,searchList){
        state.searchList=searchList
    }
}
const state= {
    searchList:{},//搜索结果信息
}
// 计算属性
const getters={
    goodsList(state){
        // 返回goodsList
        return state.searchList.goodsList || []
    },
    trademarkList(state){
        // 返回trademarkList
        return state.searchList.trademarkList || []
    },
    attrsList(state){
        // 返回attrsList
        return state.searchList.attrsList || []
    },
}

export default{
    actions,
    mutations,
    state,
    getters
}
